import { Injectable, EventEmitter, Type } from '@angular/core';
import { DialogComponent } from "./dialog/dialog.component";
import { MdDialog, MdDialogConfig } from '@angular/material';
import { Observable } from "rxjs/Observable";
// import  "rxjs/Operator/of"

@Injectable()
export class DialogService {

  constructor(public dialog: MdDialog) {

  }
  showConfirmationDialog(title: string, message: string): Observable<DialogResult> {
    return this.dialog
      .open(DialogComponent, { data: { title, message } }).afterClosed();
  }

  showDialog(title: string, message: string, dialogContainerType: Type<any>, ): Observable<DialogResult> {
    return this.dialog
      .open(dialogContainerType, { data: { title, message } }).afterClosed();
  }

}
export enum DialogResult {
  Ok,
  no,
  cancel
}




// WEBPACK FOOTER //
// ./src/app/shared/dialog.service.ts